home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The 640 MEG Shareware Studio 2
/
The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO
/
pascal
/
paspeak.zip
/
SPEAK.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1985-01-02
|
2KB
|
58 lines
Procedure Call_Speech ( var input : str ); EXTERNAL 'turbolip.com';
{ Turbolip.com interfaces pascal to the *MODIFIED*
t-speech.com module via the 'Call_Speech' procedure }
Procedure Speak ( Script : str );
{ 'Speak' checks to see if a speech module is installed.
It doesn't differentiate between the BASIC and
Pascal versions. If installed, the module is called,
otherwise an error message is printed and the program is halted.
'Call_Speech' can be called directly but only with a text
variable as its argument. You can expect an
*insta-crash* if there's no speech module installed. }
const
F2_vector = $03C6; { int $f2 calls the speech program. $0000:$03C6
contains the cs pointer for t-speech.com and int f2 }
Speech_ofs = $0100; { com files begin execution at offset $0100 }
var
Byte1, { Byte1-3 pick up the first three bytes }
Byte2, { of the cs:0100H to see if they match }
Byte3, { those of the speech module }
Speech_Code : Integer;
Begin
Speech_Code := Memw [ $0000 : F2_vector ]; { get cs of t-speech.com }
Byte1 := Mem [ Speech_Code : Speech_Ofs ]; { get first three bytes of }
Byte2 := Mem [ Speech_Code : Speech_Ofs+1 ]; { t-speech.com }
Byte3 := Mem [ Speech_Code : Speech_Ofs+2 ];
If ( Byte1 = $90 ) and ( Byte2 = $1E ) and ( Byte3 = $B8 )
{ if bytes match the reference bytes then }
{ assume that t-speech.com is installed }
Then Call_Speech ( Script )
Else Begin { t-speech.com not installed }
Write ( #7,#7,#7 );
Writeln ( 'Speech module not installed!!' );
Writeln ( 'System crash narrowly averted (Whew!).' );
Halt; { aren't you relieved?! }
End;
End;